import axios from '@/libs/api.request'

export const getTestsuiteSets = (val) => {
    return axios.request({
        url: 'api/HttpAutoTestService/testsuite_sets/',
        params: val,
        method: 'get'
    })
};

export const createTestsuiteSet = (testsuiteSet) => {
    return axios.request({
        url: 'api/HttpAutoTestService/testsuite_set/',
        data: testsuiteSet,
        method: 'post'
    })
};
export const updateTestsuiteSet = (testsuiteSet) => {
    return axios.request({
        url: `api/HttpAutoTestService/testsuite_set/${testsuiteSet.id}/`,
        data: testsuiteSet,
        method: 'put'
    })
};

export const partialUpdateTestsuiteSet = (testsuiteSet) => {
    let id = testsuiteSet.id;
    delete testsuiteSet.id;
    return axios.request({
        url: `api/HttpAutoTestService/testsuite_set/${id}/`,
        data: testsuiteSet,
        method: 'patch'
    })
};
export const batchDeleteTestsuiteSet = (data) => {
    return axios.request({
        url: 'api/HttpAutoTestService/testsuite_set/batch_delete/',
        method: 'delete',
        data: data
    })
};

export const batchExecTestsuiteSet = (data) => {
    return axios.request({
        url: 'api/HttpAutoTestService/testsuite_set/batch_exec/',
        method: 'post',
        data: data
    })
};

export const exportTestsuiteSet = (data) => {
    return axios.request({
        url: 'api/HttpAutoTestService/testsuite_set/export/',
        method: 'post',
        data: data,
        responseType: 'arraybuffer'
    })
};